Skip to content

London | May 2025 | Houssam Lahlah | Coursework/sprint 1 #657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

HoussamLh
Copy link

Self Checklist

I have committed my files one by one, on purpose, and for a reason

I have titled my PR with REGION | COHORT_NAME | FIRST_NAME LASTNAME | PROJ_NAME

I have tested my changes (where applicable)

My changes follow the style guide

My changes meet the requirements of this task

Changelist

  1. key-exercise:
    Practiced variable reassignment with count = count + 1
    Extracted initials from full names using charAt(0)
    Parsed file paths using slice() and lastIndexOf()
    Explained how random numbers are generated with Math.random() and Math.floor()

  2. mandatory-errors: Identified common learning mistakes (e.g., using const when let is needed)

  3. mandatory-interpret: Interpreted JavaScript behaviors like console.log, prompt(), and variable hoisting

  4. stretch-explore: Explored the Chrome DevTools Console and JavaScript built-in methods like alert(), prompt(), and typeof

Questions

Hello,

I’ve completed all parts of the Sprint 1 and opened this pull request for review. Could you please take a look and let me know:

Are my explanations clear and technically correct, especially in the key-exercise and mandatory-interpret sections?

Do the solutions meet the expectations for this stage of the course?
Is there anything I could improve in the way I write comments or explain code logic?
Any feedback would be appreciated — thank you for your time!

Best regards,
Sami

HoussamLh and others added 20 commits June 19, 2025 07:48
Added comments to exclude instructional lines from execution
Updated age variable to let to allow incrementing its value.
Declare variable before using in template string.
Add comments explaining slice error and fix by converting number to string.
Fix invalid variable names by renaming to start with letters instead of numbers.
Add missing comma to replaceAll so the code runs smoothly.
Add detailed comments answering questions about movie length time calculation.
Add detailed comments explaining step-by-step price formatting from pence string.
@HoussamLh HoussamLh added the Needs Review Participant to add when requesting review label Jul 13, 2025
@cjyuan cjyuan removed the Needs Review Participant to add when requesting review label Jul 17, 2025
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your explanation is clear. I only have some suggestions and a questions.

@@ -4,3 +4,4 @@ count = count + 1;

// Line 1 is a variable declaration, creating the count variable with an initial value of 0
// Describe what line 3 is doing, in particular focus on what = is doing
// line 3 is increases the value of count by 1 and saves the updated value back into count variable.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Operation like count = count + 1 is very common in programming, and there is a programming term describing such operation.

Can you find out what one-word programming term describes the operation on line 3?


1. Math.random()

Returns a random decimal number between 0 and 1 but never gives 1.0.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also use the concise and precise interval notation to describe a range of values.

  • [, ] => inclusion
  • (, ) => exclusion
    For example, we can say, "Math.random() returns a random number in the interval [0, 1)"

Comment on lines +25 to +27
// 5. Extracts the last two characters as the pence part.
// For "399", this is "99".
// Then pads the string on the right with zeros if it’s shorter than 2 characters (not needed here).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you mentioned "not needed here", do you mean we can delete .padEnd(2, "0") at line 24?
Could we expect this program to work as intended for any valid penceString if we deleted .padEnd(2, "0") from the code?

@cjyuan cjyuan added the Reviewed Volunteer to add when completing a review label Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reviewed Volunteer to add when completing a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants